package com.tensquare.recruit.controller;

import com.tensquare.recruit.pojo.Enterprise;
import com.tensquare.recruit.service.EnterpriseService;
import entity.Result;
import entity.StatusCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("enterprise")
@CrossOrigin
public class EnterpriseController {

    @Autowired
    private EnterpriseService enterpriseService;
    //热门企业列表
    //查询企业表ishot字段为1的记录
    @GetMapping(value = "search/hotlist")
    public Result findHostEnterpriseList(){
        List<Enterprise> enterpriseList=enterpriseService.findHostEnterpriseList();
        return new Result(true,StatusCode.OK,"热门企业列表",enterpriseList);
    }

}
